﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HPortal.Lib;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;

namespace HPortal.Module
{
    public partial class DSDetaiLinhvuc : PanelControl
    {   
        protected int ChannelID;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                grvManager_DataBind(1);
                cmdContinue.Visible = true;
            }
        }
        private void grvManager_DataBind(int sodetai)
        {
            ChannelID =  DatabaseHelper.SelectScalarIntFromID("ChannelID", "Panel", PanelID);
            DataTable la = DatabaseHelper.Select("Exec [KH_DSDetaiLinhvuc] " + field1 + "," + sodetai);
            this.grvLargeArticle.DataSource = la;
            grvLargeArticle.DataBind();
        }
        public string WriteArticleImage(object ImageType,  int ArticleID_, string Url)
        {

            if (ImageType != System.DBNull.Value)
            {
                string st = "<a href='default.aspx?url=" + Url + "&ArticleID=" + ArticleID_ + "&PanelID=" + base.PanelID + "&ChannelID=" + ChannelID + "'>";
                st += "<img src='/imgView.aspx?ArticleID=" + ArticleID_ + "' class='HeadImage' />";
                st += "</a>";
                return st;
            }
            return string.Empty;
        }
        protected void cmdContinue_Click(object sender, EventArgs e)
        {
            grvManager_DataBind(0);
            cmdContinue.Visible = false;
        }
    }
}